package com.example.mallware.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mallware.controller.vo.WareBySkuIdVO;
import com.example.mallware.entity.WareSkuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author charlie
 * @email @gmail.com
 * @date 2023-11-25 13:00:18
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {


    void addStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    List<WareBySkuIdVO> findWareBySkuId(@Param("skuList") List<Long> skuList);


    List<WareSkuEntity> listHashStock(@Param("skuId") Long skuId);

    Integer lockSkuStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("count") Integer count);
}
